Skip to content

Conversation

@Quinn-With-Two-Ns
Copy link
Contributor

@Quinn-With-Two-Ns Quinn-With-Two-Ns commented Oct 20, 2025

Add summary to side effect and mutable side effect.

closes #2702


Note

Add summary options to side/mutable side effects and plumb user metadata into marker/events across runtime, with API overloads and tests verifying metadata.

  • API/SDK:
    • Add SideEffectOptions and MutableSideEffectOptions with summary support.
    • Overload Workflow.sideEffect(..) and mutableSideEffect(..) (and outbound interceptor methods) to accept options.
    • Propagate summaries as UserMetadata for timers, side effects, mutable side effects, child workflows, local activities, and Nexus operations.
  • State Machines/Runtime:
    • Pass UserMetadata through SideEffectStateMachine and MutableSideEffectStateMachine; attach to RECORD_MARKER commands.
    • Extend StateMachineCommandUtils.createRecordMarker to accept optional metadata; update callers.
    • Wire metadata through ReplayWorkflowContext, WorkflowStateMachines, and SyncWorkflowContext.
  • Tests/Utilities:
    • Add and use HistoryUtils.assertEventMetadata.
    • Update unit/integration tests to verify marker/event metadata for side effects, mutable side effects, activities, local activities, child workflows, and Nexus operations.
    • Update tracing/dummy/test contexts to support new overloads.

Written by Cursor Bugbot for commit f0cafac. This will update automatically on new commits. Configure here.

@Quinn-With-Two-Ns Quinn-With-Two-Ns marked this pull request as ready for review October 20, 2025 17:30
@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner October 20, 2025 17:30
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@yuandrew yuandrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor doc comments

.build();
addCommand(StateMachineCommandUtils.createRecordMarker(markerAttributes));
addCommand(StateMachineCommandUtils.createRecordMarker(markerAttributes, metadata));
metadata = null; // only used once
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own understanding, why do we null after recording once? Is it because replay is the only time we'd re-create a marker, and we don't need this for replay?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise we just hold the metadata in memory when we no longer need it, just a memory optimization.

@Quinn-With-Two-Ns Quinn-With-Two-Ns force-pushed the side-effect-summary branch 2 times, most recently from 17deb8b to 3b53ae0 Compare October 29, 2025 22:35
@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit a7e38ec into temporalio:master Oct 31, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for static summary for side effects and mutable side effects

2 participants